import { request } from 'umi';

export interface UniversityListItem {
  universityId: number;
  universityName: string;
  universityCode: string;
  universityType: string;
  province: string;
  city: string;
  address?: string;
  introduction?: string;
  logoUrl?: string;
  status: string;
  createBy?: string;
  createTime?: string;
  updateBy?: string;
  updateTime?: string;
  remark?: string;
}

export async function getUniversityList(params?: any) {
  return request('/university/list', {
    method: 'GET',
    params,
  });
}

export async function addUniversity(data: Partial<UniversityListItem>) {
  return request('/university', {
    method: 'POST',
    data,
  });
}

export async function updateUniversity(data: Partial<UniversityListItem>) {
  return request('/university', {
    method: 'PUT',
    data,
  });
}

export async function deleteUniversity(universityId: number) {
  return request(`/university/${universityId}`, {
    method: 'DELETE',
  });
} 